package com.qf.controller;

import com.qf.Vo.StuVo;
import com.qf.service.StuClassService;
import com.qf.utils.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 以梦为马，以汗为泉，不忘初心，不负韶华
 *
 * @author
 * @version 1.0
 * @data 2025/2/17 20:24
 */
@RestController
public class StuClassController {
    @Resource
    private StuClassService stuClassService;

    @GetMapping("/stuclass")
    public R stuclass(Integer id){
        List<StuVo> allStuAndClassroom = stuClassService.findAllStuAndClassroom(id);
        return R.ok(allStuAndClassroom);
    }

    @GetMapping("/subject")
    public R subject(Integer sid){

        StuVo stuAndAllSubject = stuClassService.findStuAndAllSubject(sid);

        return R.ok(stuAndAllSubject);

    }
}
